home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The PC-SIG Library 9
/
The PC-SIG Library on CD ROM - Ninth Edition.iso
/
801_900
/
DISK0856
/
DISK0856.ZIP
/
FONTEDIT.DOC
< prev
next >
Wrap
Text File
|
1987-06-15
|
18KB
|
397 lines
Font Editing and Printing Package
Version 1.2
-- by --
Synergy Software of Nebraska
904 Lariat Circle
Papillion, NE 68046
Copyright (C) 1986,1987 by Synergy Software of Nebraska
Synergy Software of Nebraska (SSoN) is distributing
FONT EDITOR under the User Support concept. This
utility may be freely distributed to all interested
individuals without further authorization or request
from SSoN as long as the cost of distribution does not
exceed $6. However, if you like the utility, we do
request a $10 registration fee, which entitles you to
information on the latest copy of this and other
packages designed by SSoN.
SYNERGY SOFTWARE OF NEBRASKA RESERVES ALL OTHER
COPYRIGHT PRIVILEGES.
All files to this package must remain intact and unmod-
ified and the entire package cannot be sold, although a
distributing fee of up to $6 may be applied.
Since this utility is being distributed without any
charge or obligation to buy, Synergy Software of
Nebraska disclaims all warranties with respect to the
contents of this package and specifically disclaims any
implied warranties of merchantability or fitness for
any particular purpose. (In other words, "Don't look a
gift horse in the mouth.")
The source code, incidentally, is available in Turbo
Pascal for $10.
Requires IBM-PC or campatible machine with CGA video.
1 Font Editor Version 1.2
Font Editor : Version 1.2
This package:
One of the great things about the IBM-PC and family of computers is the
ability to create and display your own special font characters. This Font
Editor package not only will help you design the special characters with the
interactive programs, but contains utilities to demonstrate the method by
which the fonts can be generated on the display console.
There are, unfortunately, several restrictions placed upon this capa-
bility. First, the special characters can only be displayed using the
graphics modes of a Color/Graphics Adaptor (CGA) or Enhanced Graphics Adaptor
(EGA) emulating the CGA. If you are using a monochrome display system, this
program will not work. Sorry, there is nothing that can be done about this.
Second, the special font characters are only created in the graphics
modes of the system (modes 0 through 3) which are the medium and high resol-
ution graphics modes. These modes, unlike the text modes where the ASCII
character codes are stored in the display memory, actually place the bit maps
of the characters into the display memory area. (This is why the special
fonts can be displayed.) In the medium resolution modes, characters are
displayed in 40 columns across the screen; while in high resolution modes,
characters are displayed in 80 columns. Of course, this is not the problem.
The problem is that the CGA has limited memory resources and therefore can
only display 4 colors in medium res modes and 2 colors in high res modes.
Refer to your hardware reference manual (or any of a thousand books on the IBM
system hardware) for the reasons why this is so.
Third, only the upper 128 characters of the video codes are redefinable.
The lower 128 characters (called the ASCII codes) are in the system's ROM at
high memory and cannot be changed. (You can load them into RAM and modify
them to your liking, though!)
With these restrictions, I still feel the IBM has the potential of being
somewhat flexible in what it can display if the software is designed right.
This package will help you in doing just that.
What this package includes:
This package is made up of two Font Editors (one for medium resolution
modes and one for high resolution modes) and a Turbo Pascal routine library
that will demonstrate how the created fonts are loaded from file, integrated
into the BIOS system of the computer, and thus made available to the BIOS
display routines.
The reason why there are two editors is because special font characters
created in medium resolution modes look different when displayed in the high
resolution modes (and vice versa). The two editors are almost exactly the
same. The medium resolution editor ("FONTED40.COM"), however, is limited in
the number of characters that can be displayed on the screen (40 characters
across) and thus is not as verbose as the 80 column editor. The best way to
learn how to use the editors is to work with the 80 column editor
("FONTED80.COM") until you feel comfortable with the questions asked and the
options available.
2 Font Editor Version 1.2
The Turbo Pascal routine library is discussed more fully in a section
below. The following are the files and their date/time tags and sizes that
are included in this package. If any of these files are missing, or if any
have been altered in any way, please contact us and we will provide you with
the entire package.
SCRIPT40 FNT 1024 6-14-87 10:06p - Sample font provided with pkg
FONTED40 FNT 1024 6-06-87 9:02a - Font set used by editor
SCRIPT80 FNT 1024 6-14-87 10:44p - Sample font provided with pkg
FONTED80 FNT 1024 6-06-87 8:57a - Font set used by editor
FONTEDIT DOC 19456 6-14-87 11:05p - Documentation to this package
FONTS LIB 8184 6-14-87 10:23p - Turbo Pascal library for access
SAMPLE PAS 2422 6-14-87 10:28p - Sample Program using FONTS.LIB
FONTED40 COM 23797 6-14-87 10:48p - 40 column font editor
FONTED80 COM 24166 6-14-87 10:48p - 80 column font editor
The Font Editors:
Since the commands and keys for both editors are the same, when the
editor is mentioned, I actually mean either one.
When you begin execution of the editor, it will first ask you for the
name of the font file to be edited. Like a text file, or other data file, the
font descriptions (the bit mapping of each special character font) are saved
off into a file with a specific name and can be called up at any time for
further editing. Each file contains the bit mapping of a single font set (for
the entire 128 characters). If you do not specify a file name, "WORK.FNT" is
loaded. Of course, if the file does not exist, the new file is created
automatically. With new files, all special font characters are "cleared" or
have their bits all set to "0".
Once the font file is loaded, the main editor screen is displayed. The
upper left corner of the screen displays the main function key options, the
upper middle and right screen area is used while editing a specific character
and will be discussed later, and the bottom half of the screen displays the
state of the entire font set as it presently exists (all 128 characters). An
arrow character will appear at the location (0,0).
NOTE: From this point on, (x,y) will refer to the location within the font
table where "x", the first digit (from 0 to 7), is the row down the screen and
"y", the second digit (from 0 to F [hex]), is the column position across the
screen. Locations correspond to the ASCII values of the characters in hexa-
decimal format. That is (x,y) is associated with the ASCII character with the
hex value of xy. For example, the character "a" has a ASCII hex value of 61;
therefore, the corresponding location in the table is (6,1), or the 7th row
and 2nd column.
Moving the Arrow Pointer:
The arrow pointer is used to select the specific character you wish to
work with. It may be used in telling the editor which character to edit or to
copy. Think of the arrow pointer as the location where activity is to take
place.
3 Font Editor Version 1.2
The pointer is moved using the four arrow keys on the keypad. In addi-
tion, the <Home>, <End>, <CTRL><HOME>, and <CTRL><END> keys are supported with
this version. These four keys move the arrow pointer to the beginning of the
present row, end of the present row, top left corner of the character set, and
bottom right corner of the character set respectively.
Loading a New File:
The F1 key is used to load a new file from disk. If the present font set
has not been saved since an update has occurred, the editor will give you the
option to save the file before loading a new one. When entering the file name
(after any of the prompts in the program), the file extension ".FNT" is
assumed if not entered. (In fact, I suggest you always use the file extension
default. This will prevent any problems from occurring in confusing font
files with other types of data files.)
Saving the Font to File:
To save the presently loaded font to file, use the F2 key. It is a good
idea to get into the habit of saving the font after every 10 to 15 minutes of
work. This could save you from losing a lot of hard work if the power were to
go out on your system.
The editor will let you specify the file to save to, though the default
name is the name of the font file you are presently working with.
Copying characters:
You can copy character bit maps directly from one to another character
through the main menu with the F7 key; thus eliminating having to enter the
editor mode (described below) just to perform this task. To copy a font
character, move the arrow to the location where the character is to be copied
TO and strike the F7 key. You will then be prompted to select the character
from which to copy FROM by again moving the arrow and striking the RETURN key.
You can abort the copy action by simply striking the ESC key at the prompt.
Copying the entire ROM Character set:
A feature has been provided that will allow you to copy the entire ROM'ed
character set into the working table. The F6 key performs this operation.
Make sure that before you make the copy, the contents of the present font set
is saved. Once the ROM set is loaded, you can then manipulate the characters
in any fashion you desire and then save it to a font file, just like any other
font created with this editor.
Finding a Character:
Since most of the time, you will probably be creating your own text fonts
where the special characters you enter are to replace existing alphanumerics,
a function was provided to help you "jump" to the location corresponding to
a specific alphanumeric. This is particularly helpful when starting with a
4 Font Editor Version 1.2
completely blank table and you are only interested in filling a few
characters, thus reducing needless searching for the right location.
When you strike the F8 key, you are prompted to strike the key of the
character you wish the arrow pointer to jump to. The ASCII value is computed
from the key you press, and the arrow pointer is relocated.
Quiting the Editor:
The F10 key is used to exit the program gracefully. If you have modified
any of the characters since the last save command, the editor will inform you
and give you an opportunity to save to file.
Editing a Character:
The F5 key is used to edit a specific character: where the arrow pointer
is located. Once you have entered the edit mode, you will be working in the
upper half of the screen. Notice that the function key commands change when
you enter the edit mode, and a large cursor is positioned within the 8 x 8
matrix in the upper middle portion of the screen. This matrix represents
individual "bits" or "pixels" (picture elements) by which the characters are
made up.
The arrow keys are used to move the cursor about the matrix, and the
space bar is used to change a specific bit from "ON" to "OFF" or vice versa.
The <Home>, <End>, <PgUp>, and <PgDn> keys are also supported: these cause the
cursor to move diagonally in the direction of the key. As you change the bits
on the matrix, you will notice the character to the immediate right of the
matrix will also change. This is what the character actually looks like, and
will help you decide on which bits should be "ON" and which should be "OFF".
Many of the function keys are self-explanatory and do not need to be
expanded upon. The F3, F4, F5, <ALT> F5, and F6 rotate the character as if it
were cylindrical (the right side attached to the left, or the top attached to
the bottom). The inversion keys F7 and F8 present the "mirror image" of the
original either horizontally or vertically. The F2 key switches all "ON"
pixels to "OFF" and vice versa, thus making the new character the negative
image of the original.
The F1 key performs the same task as the F7 key from the main "Selector"
mode of the editor. You will be prompted to move the arrow pointer to the
location to copy FROM and hit RETURN or to enter ESC to abort the copy action.
The F9 and F10 are the exit keys to return command back to the "Selector"
mode. The only difference is that F9 saves the changes you have made to the
character; F10 does not.
A few points to remember:
There are two files included in this package ("FONTED40.FNT" and
"FONTED80.FNT") which are fonts designed to work with the font editors
themselves. I suggest you do not tamper with these fonts. However, on the
chance that you do not like the "cursor" characters and "ON/OFF" characters
the Editor mode of the editors use, you can redefine them by loading the
appropriate font file and changes (0,0) through (0,3). We recommend you do
not, but ...
5 Font Editor Version 1.2
Another point to remember in using your own fonts is that it is possible
to display characters created from a variety of font files on the same screen!
Remember that the characters are displayed in their bit format and not their
ASCII value as in text mode. Therefore, you can load one font file, write to
the screen, load another font file, and write to the screen, etc.... Once the
image is computed onto the screen, no further accesses are made to update the
image.
When you look at the Turbo Pascal source code that is included in this
package, you will notice that it was designed to allow you to load into RAM up
to three different font sets and by simply calling a single procedure, jump
between the fonts as the active font. Here is the catch: if you are familiar
with the ROM BIOS routines, you know there is a way to read the characters
displayed on the screen. This routine works whether the system is in text or
graphics mode! In text mode, reading the character at a specific location is
easy: just read the ASCII value at that memory location. However, in the
graphics mode, the BIOS actually goes out and reads in the bit map at that
location, and then goes to the bit mapping of the character font and looks for
a match! This is very flexible, but you need to make sure that when, or if, a
program tries to READ a character at a specific location in graphics mode, you
have the same font set active as the one used to create the character.
The data files stored to disk are the EXACT image the system expects to
find the character fonts in when it access the area through the interrupt.
This means that there are no special translations from reading the data to
creating the font work area for DOS. The result is that once you have created
a font set to your satisfaction, you can access and use the file with
assembler, Pascal, C, BASIC, or any other language that allows you to do the
following actions:
a) load the ENTIRE contents of a font file into a specific location in
memory,
b) and access the DOS routine to change a specific interrupt vector's
location to point to the location the font file was loaded.
The Turbo Pascal routine package provided uses DOS to change the
interrupt vector's address. Although it is possible to directly change the
address, it is always good programming practice to let DOS do this, to keep
compatibility with future DOS machines and to handle situations when inter-
rupts occur WHILE the interrupt vector is being modified.
That is it! I hope you enjoy this package and I hope it comes in handy
in developing your own fonts. Strategically designed, a program can look
quite nice while using this feature. In fact, this editor can help you design
game graphics characters that make manipulation of objects on the screen
faster, easier, and neater to code. Remember, if you like this package,
please register with Synergy Software of Nebraska with a $10 donation.
Thanks for using our products.
Synergy Software of Nebraska
904 Lariat Circle
Papillion, NE 68046
6 Font Editor Version 1.2